<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/order.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="location = '<?php echo $insert; ?>'" class="button"><?php echo $button_insert; ?></a></div>
    </div>
    <div class="content">
      <form action="#" method="post" enctype="multipart/form-data" id="form">
        <table class="list">
          <thead>
            <tr>
              <td class="left"><?php echo $column_name; ?></td>
              <td class="left"><?php if ($sort == 'ad.display_name') { ?>
                <a href="<?php echo $sort_display_name; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_display_name; ?></a>
                <?php } else { ?>
                <a href="<?php echo $sort_display_name; ?>"><?php echo $column_display_name; ?></a>
                <?php } ?></td>
              <td class="left"><?php echo $column_group_id; ?></td>
              <td class="left"><?php echo $column_group_name; ?></td>
              <td class="left"><?php if ($sort == 'group_display_name') { ?>
                <a href="<?php echo $sort_group_display_name; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_group_display_name; ?></a>
                <?php } else { ?>
                <a href="<?php echo $sort_group_display_name; ?>"><?php echo $column_group_display_name; ?></a>
                <?php } ?></td>
              <td class="right"><?php echo $column_action; ?></td>
            </tr>
          </thead>
          <tbody>
            <tr class="filter">
              <td></td>
              <td><input type="text" name="filter_display_name" value="<?php echo $filter_display_name; ?>" /></td>
              <td><input type="text" name="filter_group_id" value="<?php echo $filter_group_id; ?>" /></td>
              <td></td>
              <td><input type="text" name="filter_group_display_name" value="<?php echo $filter_group_display_name; ?>" /></td>
              <td align="right"><a onclick="filter();" class="button"><?php echo $button_filter; ?></a></td>
            </tr>
            <?php if ($attributes) { ?>
            <?php foreach ($attributes as $attribute) { ?>
            <tr>
              <td class="left"><?php echo $attribute['name']; ?></td>
              <td class="left"><?php echo $attribute['display_name']; ?></td>
              <td class="left"><?php echo $attribute['attribute_group_id']; ?></td>
              <td class="left"><?php echo $attribute['group_name']; ?></td>
              <td class="left"><?php echo $attribute['group_display_name']; ?></td>
              <td class="right"><?php foreach ($attribute['action'] as $action) { ?>
                [ <a href="<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a> ]
                <?php } ?></td>
            </tr>
            <?php } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="6"><?php echo $text_no_results; ?></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </form>
      <div class="pagination"><?php echo $pagination; ?></div>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
function filter() {
	url = 'index.php?route=product/attribute&token=<?php echo $token; ?>';
	var filter_display_name = $('input[name=\'filter_display_name\']').attr('value');
	if (filter_display_name) {
		url += '&filter_display_name=' + encodeURIComponent(filter_display_name);
	}
	var filter_group_display_name = $('input[name=\'filter_group_display_name\']').attr('value');
	if (filter_group_display_name) {
		url += '&filter_group_display_name=' + encodeURIComponent(filter_group_display_name);
	}
	var filter_group_id = $('input[name=\'filter_group_id\']').attr('value');
	if (filter_group_id) {
		url += '&filter_group_id=' + encodeURIComponent(filter_group_id);
	}
	location = url;
}
//--></script>
<?php echo $footer; ?>